package com.lixinlei.meetingfilm.consumer.feign;

import com.lixinlei.meetingfilm.consumer.feign.vo.UserModel;
import org.springframework.stereotype.Service;

/**
 * Feign 调用 - 业务降级的方法(基于 feign.hystrix.FallbackFactory 的降级实现)
 */
@Service
public class FallbackFactoryImpl implements feign.hystrix.FallbackFactory {

    @Override
    public ProviderApi create(Throwable throwable) {
        return new ProviderApi() {
            @Override
            public String invokerProviderController(String message) {
                return "invokerProviderController FallbackFactory message = "+message;
            }

            @Override
            public String providerPost(String author, String providerId, UserModel userModel) {
                return "providerPost FallbackFactory ...";
            }
        };
    }

}
